using System.Data;
using System.Text;
using Lamex.Base.Framework.BaseAbs; 
using Lamex.Base.Framework.BaseDal; 
using  Lamex.mDashboard.Interface; 
using  Lamex.mDashboard.Model; 
namespace Lamex.mDashboard.DalServer 
{
 public class B_ST_ProductDefinie : BaseDalSQL<B_ST_ProductDefinieInfo>,IB_ST_ProductDefinie
  {
        public DataSet GetProcessList(string TypeName)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append(@"
            select a.ngNo,  case when  a.wordtime< 32767 then  a.wordtime-a.netime else  (65535-a.wordtime) end as UseTime,writetime Uptime, ROW_NUMBER() over(order by writetime) as rows from
            [Edgeband_Program].[dbo].[ST_S08_Receive_Data] a where a.ngNo=1 and  CONVERT (nvarchar(10),writetime,120)= CONVERT (nvarchar(10),GETDATE(),120) and startIndex!=2 and wordtime!=0 order by writetime 
            
            select a.ngNo,  case when  a.wordtime< 32767 then  a.wordtime-a.netime else  (65535-a.wordtime) end as UseTime,writetime Uptime, ROW_NUMBER() over(order by writetime) as rows from
            [Edgeband_Program].[dbo].[ST_S08_Receive_Data] a where a.ngNo=2 and  CONVERT (nvarchar(10),writetime,120)= CONVERT (nvarchar(10),GETDATE(),120) and startIndex!=2 and wordtime!=0 order by writetime 

            select a.ngNo,  case when  a.wordtime< 32767 then  a.wordtime-a.netime else  (65535-a.wordtime) end as UseTime,writetime Uptime, ROW_NUMBER() over(order by writetime) as rows from
            [Edgeband_Program].[dbo].[ST_S08_Receive_Data] a where a.ngNo=3 and  CONVERT (nvarchar(10),writetime,120)= CONVERT (nvarchar(10),GETDATE(),120) and startIndex!=2 and wordtime!=0 order by writetime 
                
            select a.ngNo,  case when  a.wordtime< 32767 then  a.wordtime-a.netime else  (65535-a.wordtime) end as UseTime,writetime Uptime, ROW_NUMBER() over(order by writetime) as rows from
            [Edgeband_Program].[dbo].[ST_S08_Receive_Data] a where a.ngNo=4 and  CONVERT (nvarchar(10),writetime,120)= CONVERT (nvarchar(10),GETDATE(),120) and startIndex!=2 and wordtime!=0 order by writetime 
            
select a.ngNo,  case when  a.wordtime< 32767 then  a.wordtime-a.netime else  (65535-a.wordtime) end as UseTime,writetime Uptime, ROW_NUMBER() over(order by writetime) as rows from
            [Edgeband_Program].[dbo].[ST_S08_Receive_Data] a where a.ngNo=5 and  CONVERT (nvarchar(10),writetime,120)= CONVERT (nvarchar(10),GETDATE(),120) and startIndex!=2 and wordtime!=0 order by writetime 

               select a.ngNo,  case when  a.wordtime< 32767 then  a.wordtime-a.netime else  (65535-a.wordtime) end as UseTime,writetime Uptime, ROW_NUMBER() over(order by writetime) as rows from
            [Edgeband_Program].[dbo].[ST_S08_Receive_Data] a where a.ngNo=6 and  CONVERT (nvarchar(10),writetime,120)= CONVERT (nvarchar(10),GETDATE(),120) and startIndex!=2 and wordtime!=0 order by writetime 
            
select a.ngNo,  case when  a.wordtime< 32767 then  a.wordtime-a.netime else  (65535-a.wordtime) end as UseTime,writetime Uptime, ROW_NUMBER() over(order by writetime) as rows from
            [Edgeband_Program].[dbo].[ST_S08_Receive_Data] a where a.ngNo=7 and  CONVERT (nvarchar(10),writetime,120)= CONVERT (nvarchar(10),GETDATE(),120) and startIndex!=2 and wordtime!=0 order by writetime 

            select a.ngNo,  case when  a.wordtime< 32767 then  a.wordtime-a.netime else  (65535-a.wordtime) end as UseTime,writetime Uptime, ROW_NUMBER() over(order by writetime) as rows from
            [Edgeband_Program].[dbo].[ST_S08_Receive_Data] a where a.ngNo=8 and  CONVERT (nvarchar(10),writetime,120)= CONVERT (nvarchar(10),GETDATE(),120) and startIndex!=2 and wordtime!=0 order by writetime 
        
");
           
            return  base.GetDataSetBySql(strSql.ToString());
        }
    }
}
